/*
 * @Description:
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2023-06-20 18:06:15
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2024-01-15 14:38:14
 */
// 列表
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [],
}

export const importConfig = {
	tabSteps: [
		{
			label: '下载模板',
			download: '下载模板',
			active: 1,
			rules: [
				{
					label: '下载最新导入模板。共1个：',
					children: [
						{
							label: '《楼栋信息导入模板》',
							link: true,
							url: 'view_dpOrgBulidingInfo_downloadTemplate',
						},
					],
				},
			],
		},
		{
			label: '导入信息',
			description: '',
			uploadTip: '楼栋信息',
			active: 2,
			url: 'view_dpOrgBulidingInfo_import',
			code: 3204,
			rules: [
				{
					label: '导入规则说明:',
					children: [
						{
							label: '(1)导入模式为“覆盖导入”，待导入的信息会覆盖平台已存在的',
						},
					],
				},
			],
		},
	],
	dataType: 9,
}

export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'top',
	column: [
		{
			label: '养老机构',
			prop: 'creditCode',
			propName: 'organizationName',
			type: 'remoteSelect',
			api: 'view_dpServiceOrgBase_page',
			filterKey: 'creditCode',
			filterLabel: 'organizationName',
			multiple: false,
			changeField: true,
			viewDisplay: false,
			rules: [{ required: true, message: '请输入当前所在单位' }],
			span: 12,
		},
		{ label: '楼栋名称', prop: 'buildingName', span: 12 },
		{ label: '楼栋总层数', prop: 'buildingFloors', span: 12 },
		{
			label: '是否有电梯',
			prop: 'elevator',
			propName: 'elevatorLabel',
			changeField: true,
			code: 'COMMON_FLAG',
			type: 'remoteSelect',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 12,
		},
		{ label: '楼栋地址', type: 'textarea', prop: 'buildingAddress', span: 24 },
	],
}

export const baseConfig = {
	pageName: '机构楼栋管理',
	// 数据字典
	dictcodes: ['COMMON_FLAG'],
	addLabel: '新增楼栋',
	rowKey: 'id',
	tipLabel: 'buildingName',
	api: {
		index: 'view_dpOrgBulidingInfo_page',
		detail:'view_dpOrgBulidingInfo_view',
		add: 'view_dpOrgBulidingInfo_add',
		edit: 'view_dpOrgBulidingInfo_edit',
		delete: 'view_dpOrgBulidingInfo_del',
		import: 'view_dpOrgBulidingInfo_import',
	},
	auth: {
		index: 'view_dpOrgBulidingInfo_page',
		detail:'view_dpOrgBulidingInfo_view',
		add: 'view_dpOrgBulidingInfo_add',
		edit: 'view_dpOrgBulidingInfo_edit',
		delete: 'view_dpOrgBulidingInfo_del',
		import: 'view_dpOrgBulidingInfo_import',
	},
	// 当前行操作按钮
	menuBtn: [
		{
			icon: 'detail',
			label: '查看',
			operate: 'detail',
			auth: 'view_dpOrgBulidingInfo_page',
			text: true,
			show: true,
		},
		{
			icon: 'editor',
			label: '编辑',
			operate: 'edit',
			auth: 'view_dpOrgBulidingInfo_edit',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			operate: 'delete',
			auth: 'view_dpOrgBulidingInfo_del',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '80%',
	},
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{ label: '楼栋名称', prop: 'buildingName', span: 6 },
			{ label: '楼栋地址', prop: 'buildingAddress', span: 6 },
			{
				label: '是否有电梯',
				prop: 'elevator',
				propName: 'elevatorLabel',
				changeField: true,
				code: 'COMMON_FLAG',
				type: 'remoteSelect',
				api: 'getDictItemList',
				filterKey: 'value',
				multiple: false,
				span: 6,
			},
		],
	},
	tableConfig,
	detailConfig: formConfig,
	formConfig,
	importConfig,
}
